import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/chatMessages',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/chatMessages/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/chatMessages',
    method: 'put',
    data
  })
}

export function getOnlineUsers() {
  return request({
    url: 'api/chatMessages/getOnlineUsers',
    method: 'get'

  })
}

export function getMessage(sender, receiver) {
  return request({
    url: 'api/chatMessages/getMessage/' + sender + '/' + receiver,
    method: 'get'

  })
}
export default { add, edit, del, getOnlineUsers, getMessage }
